package com.ainiyar.springweb.config.web;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;

/**************************************
 * File Name : WebProperties
 * Created with : IntelliJ IDEA.
 * Author : 艾尼亚尔·毛拉吾提
 * QQ : 524155792  WeChat : ainiyar0124
 * Created Time : 2024/2/4  16:25
 * Desc :统一前缀处理类
 ***************************************/
@Data
@Validated
@Component
public class WebPrefix {
    /**
     * 后台前缀
     */
    Api admin = new Api("admin", "**.controller.admin**");
    /**
     * 小程序前缀处理
     */
    Api applet = new Api("applet", "**.controller.applet**");

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Api {

        @NotEmpty
        private String prefix;

        @NotEmpty
        private String controllerPath;
    }
}

